// 补充案例1：请分析以下代码的运行过程
setTimeout(function() {
    console.log('timeout1');
    new Promise(function(resolve1) {
        console.log('promise1');
        resolve1();
    }).then(function() {
        console.log('then1')
    })
}, 20)

new Promise(function(resolve2) {
    console.log('promise2');
    resolve2();
}).then(function() {
    console.log('then2')
})

setTimeout(function() {
    console.log('timeout2');
}, 10)

setTimeout(function() {
    console.log('timeout3');
    new Promise(function(resolve3) {
        console.log('promise3');
        resolve3();
    }).then(function() {
        console.log('then3')
    })
})
console.log('global');